<template>
    <div class="reduce-promotion gift-promotion">
        <!-- 基础设置 -->
        <navTitle>基础设置</navTitle>
        <div class="base-setting">
            <Form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="80">
                <div class="name-explain">
                    <FormItem label="促销名称" prop="name">
                        <Input v-model="formValidate.name" style="width:300px" placeholder="请输入名称"/>
                    </FormItem>
                    <FormItem label="促销说明" prop="name">
                        <Input v-model="formValidate.name" style="width:300px" placeholder="请输入使用说明"/>
                    </FormItem>
                </div>
                <div class="start-end">
                    <FormItem label="使用期限">
                        <Row>
                            <Col span="11">
                                <FormItem prop="date">
                                    <DatePicker type="date" placeholder="开始时间" v-model="formValidate.date"></DatePicker>
                                </FormItem>
                            </Col>
                            <Col span="2" style="text-align: center">-</Col>
                            <Col span="11">
                                <FormItem prop="time">
                                    <DatePicker type="date" placeholder="结束时间" v-model="formValidate.time"></DatePicker>
                                </FormItem>
                            </Col>
                        </Row>
                    </FormItem>
                </div>
                <div class="active-object">
                    <FormItem label="活动对象" prop="interest">
                        <CheckboxGroup v-model="formValidate.interest">
                            <Checkbox label="普通会员"></Checkbox>
                            <Checkbox label="VIP"></Checkbox>
                            <Checkbox label="黄金VIP"></Checkbox>
                        </CheckboxGroup>
                    </FormItem>
                </div>
                <FormItem label="活动备注" prop="name" >
                    <Input v-model="formValidate.name" type="textarea" style="width:300px" placeholder="请输入活动备注"/>
                </FormItem>
            </Form>
        </div>
         <navTitle >选择商品</navTitle>
         <div class="reduce-content">
             <setcommidy  ></setcommidy>
         </div>
         <navTitle >已选商品</navTitle>
         <div class="reduce-content">
              <activecommidy></activecommidy>
         </div>
    </div>
</template>
<script>
import navTitle from '../singleSale/edit/navTitle'
import setcommidy from './list/setcommidy'
import activecommidy from './list/activecommidy'
export default {
    name: 'suitProduct',
    components: {
        navTitle,
        setcommidy,
        activecommidy
    },
    computed: {
        gender (val) {
        let word;
         if (this.formValidate.gender == '1') {
             word = '活动商品'
         }else if (this.formValidate.gender == '2'){
             word = "不参加活动的商品"
         }
         return word;
        }
    },
    data () {
        return {
            selectType: false,
            formValidate: {
                name: '',
                date: '',
                time: '',
                interest: '',
                gender: '0',
                city: "",
                name1: ''
            },
            ruleValidate: {
                name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
                date: [{ required: true, message: '请开始时间', trigger: 'blur' }],
                time: [{ required: true, message: '请结束时间', trigger: 'blur' }],
                interest: [{ required: true, message: '请选择活动对象', trigger: 'blur' }],
                city: [{ required: true, message: '请选择活动对象', trigger: 'blur' }]
            }
        }
    },
    mounted () {
    //   alert(1)  
    },
    methods: {
        choiceSelect (val) {
            switch (val) {
                case '1':
                    this.selectType = false;
                break;
                case '2':
                    this.selectType = true;
                break;
            }
        },
        RadioType (val) {
            // debugger
            switch (val) {
                case  '1':
                break;
            }
            // debugger;
        }
    }
}
</script>

